/*
 * Copyright (c) 2023 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records;

import java.sql.Timestamp;
import java.util.UUID;
import org.ehrbase.migration.exporter.v0.jooq.pg.tables.SessionLog;
import org.jooq.Field;
import org.jooq.Record2;
import org.jooq.Record8;
import org.jooq.Row8;
import org.jooq.impl.UpdatableRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class SessionLogRecord extends UpdatableRecordImpl<SessionLogRecord>
        implements Record8<UUID, String, String, String, String, Timestamp, String, Short> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>ehr.session_log.id</code>.
     */
    public void setId(UUID value) {
        set(0, value);
    }

    /**
     * Getter for <code>ehr.session_log.id</code>.
     */
    public UUID getId() {
        return (UUID) get(0);
    }

    /**
     * Setter for <code>ehr.session_log.subject_id</code>.
     */
    public void setSubjectId(String value) {
        set(1, value);
    }

    /**
     * Getter for <code>ehr.session_log.subject_id</code>.
     */
    public String getSubjectId() {
        return (String) get(1);
    }

    /**
     * Setter for <code>ehr.session_log.node_id</code>.
     */
    public void setNodeId(String value) {
        set(2, value);
    }

    /**
     * Getter for <code>ehr.session_log.node_id</code>.
     */
    public String getNodeId() {
        return (String) get(2);
    }

    /**
     * Setter for <code>ehr.session_log.session_id</code>.
     */
    public void setSessionId(String value) {
        set(3, value);
    }

    /**
     * Getter for <code>ehr.session_log.session_id</code>.
     */
    public String getSessionId() {
        return (String) get(3);
    }

    /**
     * Setter for <code>ehr.session_log.session_name</code>.
     */
    public void setSessionName(String value) {
        set(4, value);
    }

    /**
     * Getter for <code>ehr.session_log.session_name</code>.
     */
    public String getSessionName() {
        return (String) get(4);
    }

    /**
     * Setter for <code>ehr.session_log.session_time</code>.
     */
    public void setSessionTime(Timestamp value) {
        set(5, value);
    }

    /**
     * Getter for <code>ehr.session_log.session_time</code>.
     */
    public Timestamp getSessionTime() {
        return (Timestamp) get(5);
    }

    /**
     * Setter for <code>ehr.session_log.ip_address</code>.
     */
    public void setIpAddress(String value) {
        set(6, value);
    }

    /**
     * Getter for <code>ehr.session_log.ip_address</code>.
     */
    public String getIpAddress() {
        return (String) get(6);
    }

    /**
     * Setter for <code>ehr.session_log.sys_tenant</code>.
     */
    public void setSysTenant(Short value) {
        set(7, value);
    }

    /**
     * Getter for <code>ehr.session_log.sys_tenant</code>.
     */
    public Short getSysTenant() {
        return (Short) get(7);
    }

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    @Override
    public Record2<UUID, Short> key() {
        return (Record2) super.key();
    }

    // -------------------------------------------------------------------------
    // Record8 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row8<UUID, String, String, String, String, Timestamp, String, Short> fieldsRow() {
        return (Row8) super.fieldsRow();
    }

    @Override
    public Row8<UUID, String, String, String, String, Timestamp, String, Short> valuesRow() {
        return (Row8) super.valuesRow();
    }

    @Override
    public Field<UUID> field1() {
        return SessionLog.SESSION_LOG.ID;
    }

    @Override
    public Field<String> field2() {
        return SessionLog.SESSION_LOG.SUBJECT_ID;
    }

    @Override
    public Field<String> field3() {
        return SessionLog.SESSION_LOG.NODE_ID;
    }

    @Override
    public Field<String> field4() {
        return SessionLog.SESSION_LOG.SESSION_ID;
    }

    @Override
    public Field<String> field5() {
        return SessionLog.SESSION_LOG.SESSION_NAME;
    }

    @Override
    public Field<Timestamp> field6() {
        return SessionLog.SESSION_LOG.SESSION_TIME;
    }

    @Override
    public Field<String> field7() {
        return SessionLog.SESSION_LOG.IP_ADDRESS;
    }

    @Override
    public Field<Short> field8() {
        return SessionLog.SESSION_LOG.SYS_TENANT;
    }

    @Override
    public UUID component1() {
        return getId();
    }

    @Override
    public String component2() {
        return getSubjectId();
    }

    @Override
    public String component3() {
        return getNodeId();
    }

    @Override
    public String component4() {
        return getSessionId();
    }

    @Override
    public String component5() {
        return getSessionName();
    }

    @Override
    public Timestamp component6() {
        return getSessionTime();
    }

    @Override
    public String component7() {
        return getIpAddress();
    }

    @Override
    public Short component8() {
        return getSysTenant();
    }

    @Override
    public UUID value1() {
        return getId();
    }

    @Override
    public String value2() {
        return getSubjectId();
    }

    @Override
    public String value3() {
        return getNodeId();
    }

    @Override
    public String value4() {
        return getSessionId();
    }

    @Override
    public String value5() {
        return getSessionName();
    }

    @Override
    public Timestamp value6() {
        return getSessionTime();
    }

    @Override
    public String value7() {
        return getIpAddress();
    }

    @Override
    public Short value8() {
        return getSysTenant();
    }

    @Override
    public SessionLogRecord value1(UUID value) {
        setId(value);
        return this;
    }

    @Override
    public SessionLogRecord value2(String value) {
        setSubjectId(value);
        return this;
    }

    @Override
    public SessionLogRecord value3(String value) {
        setNodeId(value);
        return this;
    }

    @Override
    public SessionLogRecord value4(String value) {
        setSessionId(value);
        return this;
    }

    @Override
    public SessionLogRecord value5(String value) {
        setSessionName(value);
        return this;
    }

    @Override
    public SessionLogRecord value6(Timestamp value) {
        setSessionTime(value);
        return this;
    }

    @Override
    public SessionLogRecord value7(String value) {
        setIpAddress(value);
        return this;
    }

    @Override
    public SessionLogRecord value8(Short value) {
        setSysTenant(value);
        return this;
    }

    @Override
    public SessionLogRecord values(
            UUID value1,
            String value2,
            String value3,
            String value4,
            String value5,
            Timestamp value6,
            String value7,
            Short value8) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        value5(value5);
        value6(value6);
        value7(value7);
        value8(value8);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached SessionLogRecord
     */
    public SessionLogRecord() {
        super(SessionLog.SESSION_LOG);
    }

    /**
     * Create a detached, initialised SessionLogRecord
     */
    public SessionLogRecord(
            UUID id,
            String subjectId,
            String nodeId,
            String sessionId,
            String sessionName,
            Timestamp sessionTime,
            String ipAddress,
            Short sysTenant) {
        super(SessionLog.SESSION_LOG);

        setId(id);
        setSubjectId(subjectId);
        setNodeId(nodeId);
        setSessionId(sessionId);
        setSessionName(sessionName);
        setSessionTime(sessionTime);
        setIpAddress(ipAddress);
        setSysTenant(sysTenant);
        resetChangedOnNotNull();
    }
}
